-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support variable input batch and SortaGrad. #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Almost LGTM.
deep_speech_2/audio_data_utils.py
Outdated
:type manifest: list | ||
:param batch_size: batch size. | ||
:type batch_size: int | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a :return: and :rtype:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
deep_speech_2/audio_data_utils.py
Outdated
:type sort_by_duration: bool | ||
:param sortagrad: Sort the audio clips by duration in the first epoc | ||
if set True (for SortaGrad). | ||
:type sortagrad: bool | ||
:param shuffle: Shuffle the audio clips if set True. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is not a thorough instance-wise shuffle, but a specific batch-wise shuffle. Could you add more explanation to users?
Besides, rename shuffle to batch_shuffle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在__batch_shuffle__里增加了更多注释。
deep_speech_2/audio_data_utils.py
Outdated
def instance_reader_creator(self, | ||
manifest_path, | ||
sort_by_duration=True, | ||
batch_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here batch_size is for batch_shuffle,
- put batch_size just before shuffle
- rename batch_size --> batch_shuffle_size (否则有点奇怪,因为函数名是instance reader,用户不知道为什么和batch_size有关?)
for a better understanding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有道理。我把代码做了调整,instance_reader_creator()只保留如何读取instance。
deep_speech_2/audio_data_utils.py
Outdated
def instance_reader_creator(self, | ||
manifest_path, | ||
sort_by_duration=True, | ||
batch_size, | ||
sortagrad=True, | ||
shuffle=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shuffle-->batch_shuffle ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉了该参数~
deep_speech_2/audio_data_utils.py
Outdated
@@ -296,7 +319,7 @@ def batch_reader_creator(self, | |||
batch_size, | |||
padding_to=-1, | |||
flatten=False, | |||
sort_by_duration=True, | |||
sortagrad=False, | |||
shuffle=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shuffle --> batch_shuffle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
manifest_path, | ||
sort_by_duration=True, | ||
shuffle=False): | ||
def __batch_shuffle__(self, manifest, batch_size): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里确实需要batch_size
,因此没有改成batch_shuffle_size
。
Fix #75